import 'package:finance_app/generated/json/base/json_convert_content.dart';
import 'package:finance_app/generated/json/base/json_field.dart';

class CoaEntity with JsonConvert<CoaEntity> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "group_name")
  String groupName;
  String name;
  String status;
  List<CoaCoaAccountHeader> coaAccountHeader;
}

class CoaCoaAccountHeader with JsonConvert<CoaCoaAccountHeader> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "coa_account_type_id")
  int coaAccountTypeId;
  String name;
  String status;
  List<CoaCoaAccountHeaderCoaAccountDetail> coaAccountDetail;
}

class CoaCoaAccountHeaderCoaAccountDetail
    with JsonConvert<CoaCoaAccountHeaderCoaAccountDetail> {
  int id;
  @JSONField(name: "company_id")
  int companyId;
  @JSONField(name: "coa_account_type_id")
  int coaAccountTypeId;
  @JSONField(name: "coa_account_header_id")
  int coaAccountHeaderId;
  @JSONField(name: "account_code")
  String accountCode;
  @JSONField(name: "external_account_code")
  String externalAccountCode;
  String name;
  dynamic description;
  @JSONField(name: "crdr_nature")
  String crdrNature;
  @JSONField(name: "business_type")
  String businessType;
  @JSONField(name: "parent_account_id")
  int parentAccountId;
  @JSONField(name: "currency_code")
  String currencyCode;
  @JSONField(name: "open_balance")
  num openBalance;
  num balance;
  @JSONField(name: "as_at")
  dynamic asAt;
  String status;
  @JSONField(name: "edit_disallowed")
  bool editDisallowed;
  @JSONField(name: "with_subaccount_id")
  int withSubaccountId;
  List<dynamic> maps;
  num hardValue;
}

class CoaByGroupEntity with JsonConvert<CoaByGroupEntity> {
  @JSONField(name: "group_name")
  String groupName;
  List<CoaCoaAccountHeaderCoaAccountDetail> coaAccountDetail;
}
